# -*-coding:utf-8-*-
import os
import re
fo = open("1.txt", "r")
print("文件名: ", fo.name)

print("是否已关闭 : ", fo.closed)
print("访问模式 : ", fo.mode)
#print("末尾是否强制加空格 : ", fo.softspace)
str1 = fo.read()
#print(str1)
fo.close()
tap = re.compile(r'<tr>(.*?)</tr>', re.S | re.M)
li = re.findall(tap, str1)
k = 0
for i in li:
    k = 1
    print('第' + str(k) + ':' )
    tap1 = re.compile(r'座落：(.*?)</a>', re.S | re.M)
    ls1 = re.findall(tap1, i)
    kk = 0
    for ii in ls1:
        kk += 1
        print('x:' + str(kk) + ':' + (ii.strip()).replace(' ', ''))
#re_comment = re.compile('<td align=[^>]*t座落：'


